Force www. on multi domain site and retain http or https [closed]

Posted by John Isaacks on Server Fault See other posts from Server Fault or by John Isaacks
Published on 2011-02-09T21:54:49Z Indexed on 2011/02/09 23:27 UTC
Read the original article Hit count: 194

I am using CakePHP which already contains an .htaccess file that looks like:

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

I want to force www. (unless it is a subdomain) to avoid duplicate content penalties.

It needs to retain http or https

Also

This application will have multiple domains pointing to it. So the code needs to be able to work with any domain.

© Server Fault or respective owner

Related posts about mod-rewrite

Related posts about .htaccess